﻿using System;
using System.Collections.Generic;
using System.Text;
using TTClassLibrary;
using TTServer.Messages;
using System.Windows.Forms;
using System.Drawing;

namespace TTServer.MessageProcessors
{
    class ScreenSizeRequestMessageProcessor: IMessageProcessor
    {
        public bool Process(libCommonClass.TTMessage message, libInterface.IClientInfoProvider clientInfoProvider)
        {
            if (message is ScreenSizeRequestMessage)
            {
                Size size = new Size(Screen.PrimaryScreen.Bounds.Width,
                Screen.PrimaryScreen.Bounds.Height);

                ScreenSizeResponseMessage res = new ScreenSizeResponseMessage(size.Width, size.Height);
                clientInfoProvider.AddToMessageQueue(res);

                return true;
            }

            return false;
        }
    }
}
